import request from '@/utils/request'

/**
 * @description: 组装开工初始化
 * @param {*} params
 */
export function getAssembleInfo(params) {
  return request({
    url: '/assemble/info',
    method: 'get',
    params
  })
}

/**
 * @description: 获取组装开工清单
 * @param {*} data
 */
export function getAssembleReport(params) {
  return request({
    url: '/assemble/start/list',
    method: 'get',
    params
  })
}

/**
 * @description: 新增组装开工
 * @param {*} data
 */
export function addAssembleReport(data) {
  return request({
    url: '/assemble/start/add',
    method: 'post',
    data
  })
}

/**
 * @description: 获取已开工数量的总和
 * @param {*} params
 */
export function sumAssembleReportQuantity(params) {
  return request({
    url: '/assemble/start/order/sum',
    method: 'get',
    params
  })
}

/**
 * @description: 获取开工记录
 * @param {*} params
 */
export function getAssembleReportItem(params) {
  return request({
    url: '/assemble/start/item',
    method: 'get',
    params
  })
}

/**
 * @description: 验证工单是否存在开工记录
 * @param {*} params
 */
export function validateAssembleBillno(params) {
  return request({
    url: '/assemble/validate/billno',
    method: 'get',
    params
  })
}

/**
 * @description: 组装完工清单
 * @param {*} data
 */
export function assembleReportConfirmList(params) {
  return request({
    url: '/assemble/start/confirm/list',
    method: 'get',
    params
  })
}

/**
 * @description: 获取已确认的不良品明细信息
 * @param {*} params
 */
export function assembleReportConfirmBadList(params) {
  return request({
    url: '/assemble/start/confirm/item/bad',
    method: 'get',
    params
  })
}

/**
 * @description: 获取组装确认信息（单项）
 * @param {*} params
 */
export function assembleReportConfirmItem(params) {
  return request({
    url: '/assemble/start/confirm/list/item',
    method: 'get',
    params
  })
}

/**
 * @description: 组装完工确认
 * @param {*} data
 */
export function addAssembleReportConfirm(data) {
  return request({
    url: '/assemble/start/confirm',
    method: 'post',
    data
  })
}

/**
 * @description: 获取临时数据
 * @param {*} data
 */
export function getAssembleReportConfirmTemp(params) {
  return request({
    url: '/assemble/confirm/temp',
    method: 'get',
    params
  })
}

/**
 * @description: 添加到临时数据
 * @param {*} data
 */
export function addAssembleReportConfirmTemp(data) {
  return request({
    url: '/assemble/confirm/temp',
    method: 'post',
    data
  })
}
